let initState = {
    name1:"张三",
    arr:[]
}
let deomoReducer = (state = initState,{type,payload})=>{ // state就是仓库里的数据，ation是用来state的唯一途径，action需要用dispatch来触发
  
    if (type == "setName") {
        return {
            ...state,
            name1:payload
        }
    }
    else if (type == "getList") {
        return {
            ...state,
            arr:payload
        }
    } else {
        return {
            ...state
        }
    }
    
}

export default deomoReducer